package com.linjiahao.serviceChat.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.TopicExchange;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;



/**
 * @Author Shinelon
 * @Date 2020/11/17 9:49
 * @Version 1.0
 */
@Configuration
public class TopicRabbitmqConfig {
    final static String message="topic.add-friend";

    @Bean
    public Queue queueMessage() {
        return new Queue(TopicRabbitmqConfig.message);
    }



    @Bean
    TopicExchange exchange() {
        return new TopicExchange("exchange");
    }

    @Bean
    Binding bindingExchangeMessage(Queue queueMessage, TopicExchange exchange) {
        return BindingBuilder.bind(queueMessage).to(exchange).with("topic.add-friend");
    }



}
